#!  python
# -*- coding: UTF-8 -*-
'''
@Author ：Star
@Date ：2022/11/18  
'''

import requests

url = "http://118.121.200.162:8086/api/v5/department"

type = ["all", "group", "top", "child"]

for i in range(len(type)):
    p = {
        "type": type[i]
    }
    print(p)
    if type[i] is "child":
        p = {
            "type": type[i],
            "parentDepartmentId": 1000
        }
    response = requests.get(url, params=p)

    print(response.json())
    assert len(response.json()) > 0

    # print(response.text)
